package com.xjm.mapper;


import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface ConfigMapper {

    @Select("select value from config where `key` = #{key}")
    String get(String key);

    @Insert("insert into config(`key`,value,created_time,updated_time) values(#{key},#{value},now(),now())")
    Integer set(String key, String value);

    @Update("update config set value = #{value} , updated_time = now() where `key` = #{key}")
    Integer update(String key, String value);

    @Delete("delete from config where `key` = #{key}")
    Integer delete(String key);
}




